load("@fbsource//tools/build_defs:rust_library.bzl", "rust_library")

oncall("sapling")

rust_library(
    name = "http-client",
    srcs = glob(["src/**/*.rs"]),
    autocargo = {"cargo_toml_config": {
        "dependencies_override": {
            "dependencies": {
                "curl": {"features": [
                    "http2",
                    "static-ssl",
                ]},
            },
        },
        "lib": {"name": "http-client"},
        "package": {
            "authors": ["Meta Source Control Team <sourcecontrol-dev@meta.com>"],
            "homepage": "https://sapling-scm.com/",
            "license": "MIT",
            "name": "sapling-http-client",
            "repository": "https://github.com/facebook/sapling",
        },
    }},
    test_deps = [
        "fbsource//third-party/rust:assert_matches",
        "fbsource//third-party/rust:crossbeam",
        "fbsource//third-party/rust:mockito",
        "fbsource//third-party/rust:zstd",
    ],
    deps = [
        "fbsource//third-party/rust:anyhow",
        "fbsource//third-party/rust:async-compression",
        "fbsource//third-party/rust:auto_impl",
        "fbsource//third-party/rust:curl",
        "fbsource//third-party/rust:curl-sys",
        "fbsource//third-party/rust:flume",
        "fbsource//third-party/rust:futures",
        "fbsource//third-party/rust:http",
        "fbsource//third-party/rust:lru-cache",
        "fbsource//third-party/rust:maplit",
        "fbsource//third-party/rust:once_cell",
        "fbsource//third-party/rust:openssl",
        "fbsource//third-party/rust:parking_lot",
        "fbsource//third-party/rust:paste",
        "fbsource//third-party/rust:pin-project",
        "fbsource//third-party/rust:regex",
        "fbsource//third-party/rust:serde",
        "fbsource//third-party/rust:serde_cbor",
        "fbsource//third-party/rust:serde_json",
        "fbsource//third-party/rust:thiserror",
        "fbsource//third-party/rust:tokio",
        "fbsource//third-party/rust:tokio-util",
        "fbsource//third-party/rust:tracing",
        "fbsource//third-party/rust:url",
        "//eden/scm/lib/async-runtime:async-runtime",
        "//eden/scm/lib/clientinfo:clientinfo",
        "//eden/scm/lib/minibytes:minibytes",
    ],
)
